package org.insidesource.flexbugs.service;

import java.util.List;

import javax.jws.WebService;

import org.insidesource.flexbugs.dao.CommentDao;
import org.insidesource.flexbugs.model.Comment;

@WebService(name="CommentService", endpointInterface="org.insidesource.flexbugs.service.CommentManager")
public class CommentManagerImpl implements CommentManager
{
	private CommentDao commentDao;
	
	public CommentManagerImpl(){}

	public void setCommentDao(CommentDao commentDao)
	{
		this.commentDao = commentDao;
	}
	
	public void deleteAllCommentsForIssueId(Long issueId)
	{
		commentDao.deleteAllCommentsForIssueId(issueId);
	}

	public List<Comment> findCommentsByIssueId(Long issueId)
	{
		return commentDao.getCommentsByIssueId(issueId);
	}

	public Comment get(Long id)
	{
		return commentDao.get(id);
	}

	public void remove(Long id)
	{
		commentDao.remove(id);
	}

	public void save(Comment comment)
	{
		commentDao.save(comment);
	}

}
